.grid-wrap {
    clear: both;
    margin: 0 auto;
    padding: 0;
    max-width: 1260px;
}

.grid {
    margin: 30px auto;
    padding: 0;
    list-style: none;
    min-height: 500px;
}

.js .grid {
    background: url(../img/loading.gif) no-repeat 50% 100px;
}

.js .grid.loaded {
    background: none;
}

.grid li {
    display: inline-block;
    overflow: hidden !important;
    width: 314px;
    text-align: left;
    vertical-align: top;
}

.js .grid li {
    display: none;
    float: left;
}

.js .grid.loaded li {
    display: block;
}

/* Anchor and image */
.grid li > a,
.grid li img {
    display: block;
    outline: none;
    border: none;
}

.grid li:hover img {
    transition: all 1.5s ease;
    transform: scale(1.1);
}

.grid li > a {
    position: relative;
    overflow: hidden !important;
    margin: 7px;
    border-radius: 5px !important;
    /*-webkit-mask-image: -webkit-radial-gradient(white, black);*/
    z-index: 1;
}

/* Curtain element */
.grid .curtain {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    width: 100%;
    height: 100%;
    background: rgba(212, 121, 32, 0.4);
}

.grid.swipe-right .curtain {
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
}

.grid.swipe-down .curtain {
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
}

.grid.swipe-rotate .curtain {
    width: 200%;
    height: 200%;
    -webkit-transform: rotate3d(0, 0, 1, 90deg);
    transform: rotate3d(0, 0, 1, 90deg);
    -webkit-transform-origin: top left;
    transform-origin: top left;
}

/* Shadow */
.grid .curtain::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    content: '';
}

.grid.swipe-right .curtain::after,
.grid.swipe-rotate .curtain::after {
    left: -100%;
}

.grid.swipe-down .curtain::after {
    top: -100%;
}

/* Title */
.grid li h3 {
    /*transition: bottom 0.2s;*/
    position: absolute;
    bottom: 13px;
    left: 0;
    margin: 0;
    padding: 18px 20px;
    color: white;
    text-shadow: black 0 0 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
    font-size: 1em;
    -webkit-transition: -webkit-transform 0.2s, color 0.2s;
    transition: transform 0.2s, color 0.2s, background-image 1s;
    text-align: center;
    z-index: 88;
}

/* Pseudo element for hover effect */
.grid li > a::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100.5%;
    height: 100.5%;
    border: 0 solid transparent;
    background: rgba(0, 0, 0, 0);
    content: '';
    -webkit-transition: border-width 0.2s, border-color 0.2s;
    transition: border-width 0.2s, border-color 0.2s;
}

.grid li h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 66;
}

.grid li.shown:hover h3 {
    transform: translateY(-30px);
    box-shadow: none;
    text-shadow: black 0 0 10px;
    /*color: black;*/
}

/* Hover effects */
.iShow:hover h3::before {
    display: block;
    opacity: 0.45;
    background-image: linear-gradient(207deg, transparent 0%, rgba(255, 255, 255, 0.9) 20%, rgba(255, 192, 203, 0.9) 40%, rgba(0, 255, 255, 0.9) 70%, rgba(255, 255, 255, 0.6) 90%, transparent 100%);
     -o-mask-image: radial-gradient(white, transparent);
    -moz-mask-image: radial-gradient(white, transparent);
    -webkit-mask-image: -webkit-radial-gradient(white,transparent);
}



.grid li.shown > a::before {
    display: none;
}

/* Animations */

/* Swipe right */
.grid.swipe-right li.animate .curtain {
    -webkit-animation: swipeRight 1.5s cubic-bezier(0.6, 0, 0.4, 1) forwards;
    animation: swipeRight 1.5s cubic-bezier(0.6, 0, 0.4, 1) forwards;
}

@-webkit-keyframes swipeRight {
    0% {
    }
    /* fixes Chrome 35.0.1916.114 issue (easing breaks) */
    50%, 60% {
        -webkit-transform: translate3d(0, 0, 0);
    }
    100% {
        -webkit-transform: translate3d(100%, 0, 0);
    }
}

@keyframes swipeRight {
    0% {
    }
    50%, 60% {
        -webkit-transform: translate3d(0, 0, 0);
        transform: translate(0);
    }
    100% {
        -webkit-transform: translate3d(100%, 0, 0);
        transform: translate3d(100%, 0, 0);
    }
}

/* Swipe down */
.grid.swipe-down li.animate .curtain {
    -webkit-animation: swipeDown 1.5s cubic-bezier(0.6, 0, 0.4, 1) forwards;
    animation: swipeDown 1.5s cubic-bezier(0.6, 0, 0.4, 1) forwards;
}

@-webkit-keyframes swipeDown {
    0% {
    }
    /* fixes Chrome 35.0.1916.114 issue (easing breaks) */
    50%, 60% {
        -webkit-transform: translate3d(0, 0, 0);
    }
    100% {
        -webkit-transform: translate3d(0, 100%, 0);
    }
}

@keyframes swipeDown {
    0% {
    }
    50%, 60% {
        -webkit-transform: translate(0);
        transform: translate(0);
    }
    100% {
        transform: translate3d(0, 100%, 0);
    }
}

/* Swipe rotate */
.grid.swipe-rotate li.animate .curtain {
    -webkit-animation: swipeRotate 1.5s ease forwards;
    animation: swipeRotate 1.5s ease forwards;
}

@-webkit-keyframes swipeRotate {
    0% {
    }
    /* fixes Chrome 35.0.1916.114 issue (easing breaks) */
    50%, 60% {
        -webkit-transform: rotate3d(0, 0, 1, 0deg);
    }
    100% {
        -webkit-transform: rotate3d(0, 0, 1, -90deg);
    }
}

@keyframes swipeRotate {
    0% {
    }
    50%, 60% {
        -webkit-transform: rotate3d(0, 0, 1, 0deg);
        transform: rotate3d(0, 0, 1, 0deg);
    }
    100% {
        -webkit-transform: rotate3d(0, 0, 1, -90deg);
        transform: rotate3d(0, 0, 1, -90deg);
    }
}

/* Shadow */
.grid li.animate .curtain::after {
    -webkit-animation: fadeOut 1.5s ease forwards;
    animation: fadeOut 1.5s ease forwards;
    -webkit-animation-delay: inherit;
    animation-delay: inherit;
}

@-webkit-keyframes fadeOut {
    0% {
    }
    /* fixes Chrome 35.0.1916.114 issue (easing breaks) */
    50%, 60% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes fadeOut {
    0% {
    }
    50%, 60% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Hide image and title and show at half time */
.js .grid li img,
.js .grid li h3 {
    visibility: hidden;
}

.grid li.animate img,
.grid li.animate h3 {
    -webkit-animation: showMe 1.5s step-end forwards;
    animation: showMe 1.5s step-end forwards;
}

@-webkit-keyframes showMe {
    from {
        visibility: hidden;
    }
    60%, 100% {
        visibility: visible;
    }
}

@keyframes showMe {
    from {
        visibility: hidden;
    }
    60%, 100% {
        visibility: visible;
    }
}

.grid li.shown img,
.grid li.shown h3 {
    visibility: visible;
}

.curtain, .curtain::after {
    -o-mask-image: radial-gradient(white, rgba(0, 0, 0, 0.5));
    -moz-mask-image: radial-gradient(white, rgba(0, 0, 0, 0.5));
    -webkit-mask-image: -webkit-radial-gradient(rgba(255, 255, 255, 0.3), rgba(0, 0, 0, 0.5));
    mask-image: radial-gradient(white, rgba(0, 0, 0, 0.5));
    /*-webkit-mask-image: -webkit-radial-gradient(rgba(255, 255, 255, 0.3), rgba(0, 0, 0, 0.8));*/
}
